from datetime import datetime, timedelta

def getYYYYMM():
    now = datetime.now()
    return now.strftime("%Y%m")

def getYYYYMMDD():
    now = datetime.now()
    return now.strftime("%Y%m%d")

def getYYYY_MM_DD():
    now = datetime.now()
    return now.strftime("%Y-%m-%d")

def getEncoding(codeName, len):
        idFn = codeName + '_id.txt'
        try:
            with open(idFn, 'r') as file:
                id = int(file.read())
        except FileNotFoundError:
            id = 0
        id += 1
        with open(idFn, 'w') as file:
            file.write(str(id))
        return getYYYYMMDD() + str(id).zfill(len)

if __name__ == "__main__":
    print(getYYYY_MM_DD())
    # aaa = getEncoding('namee-ses', 5)
    # print(aaa)



